<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            text-align: center;
        }
    </style>
</head>
<body>
    <!-- 有个button,有个h2(封校三天 快乐无边),当点击button时会显示文字，再次点击会文字会消失。 -->
    <h2 id="h2">封校三天 快乐无边</h2>
    <button onclick="start()" id="btn">关闭</button>
    <script>
        var count = 1;
        function start(){
            if (count == 0) {
                document.getElementById('h2').innerText = '封校三天 快乐无边';
                document.getElementById('btn').innerText = '关闭';
                count++;
            }else{
                document.getElementById('h2').innerText = '';
                document.getElementById('btn').innerText = '显示';
                count = 0;
            }
        }

    </script>
</body>
</html>